﻿using System;
using fastCSharp;

namespace diantou.web.topic
{
    /// <summary>
    /// 好友在话题下的问答
    /// </summary>
    [fastCSharp.code.cSharp.webView(IsPool = true, IsPage = false)]
    partial class friend : view<friend>
    {
        /// <summary>
        /// 问答集合
        /// </summary>
        [fastCSharp.emit.webView.clearMember]
        private userItem[] items;
        /// <summary>
        /// 好友在话题下的问答
        /// </summary>
        /// <param name="topicId">话题标识</param>
        /// <param name="page">分页号</param>
        /// <returns>是否成功</returns>
        private bool loadView(int topicId, int page)
        {
            if (base.load(topicId))
            {
                if (currentUser != null)
                {
                    diantou.dataAccess.item[] values = diantou.dataAccess.tcpCall.topic.getFriendAnswerQuestion(topicId, currentUser.Id, pageInfo.Size = fastCSharp.config.pub.Default.PageSize, pageInfo.Page = page, out pageInfo.Count);
                    items = values.getArray(value => new userItem { Item = value, User = currentUser });
                    return true;
                }
                AjaxResponse(webConfig.NotFound404);
            }
            return false;
        }
    }
}